﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;
using System.Collections.Generic;

namespace Nok_Air.NokObjects
{
    /*
      <BookNo>9804013</BookNo>
          <PnrBookNumb>KHLRJV</PnrBookNumb>
          <GroupName />
          <BookAgencyCode />
          <CreaDateTime>2011/03/12/15/53/22</CreaDateTime>
          <BookingStatus>Y</BookingStatus>
          <NoOfSeats>3</NoOfSeats>
          <BookCategory>S</BookCategory>
          <AgencyTradeName />
          <ExternalBookNumber />
          <OriginAddress />
          <TtyRejectIndicator>0</TtyRejectIndicator>
          <EtRejectIndicator>0</EtRejectIndicator>
          <ScrutinyFlag>N</ScrutinyFlag>
          <EtQueueCount>0</EtQueueCount>
          <TtyInQueueCount>0</TtyInQueueCount>
          <LastPaymentDateTime />
          <FareDesignator />
     */
    public class BookingItemViewModel : INotifyPropertyChanged
    {
      //  private string _;       
    
        public string Passenger
        {
            get
            {
                return App.ViewModel.Passenger;
            }
            set
            {
                if (value != App.ViewModel.Passenger)
                {
                    App.ViewModel.Passenger = value;
                    NotifyPropertyChanged("Passenger");
                }
            }
        }
        public string BookingNum
        {
            get
            {
                return App.ViewModel.BookingNum;
            }
            set
            {
                if (value != App.ViewModel.BookingNum)
                {
                    App.ViewModel.BookingNum = value;
                    NotifyPropertyChanged("BookingNum");
                }
            }
        }

        private string _BookNo;
        public string BookNo
        {
            get
            {
                return _BookNo;
            }
            set
            {
                if (value != _BookNo)
                {
                    _BookNo = value;
                    NotifyPropertyChanged("BookNo");
                }
            }
        }
        private string _NoOfSeats;
        public string NoOfSeats
        {
            get
            {
                return _NoOfSeats;
            }
            set
            {
                if (value != _NoOfSeats)
                {
                    _NoOfSeats = value;
                    NotifyPropertyChanged("NoOfSeats");
                }
            }
        }

        private string _TotalPayment;
        public string TotalPayment
        {
            get
            {
                return _TotalPayment;
            }
            set
            {
                if (value != _TotalPayment)
                {
                    _TotalPayment = value;
                    NotifyPropertyChanged("TotalPayment");
                }
            }
        }
        

        private List<BookingItemPassengers> _passengerItem;
        public List<BookingItemPassengers> PassengerItem
        {
            get
            {
                return _passengerItem;
            }
            set
            {
                if (value != _passengerItem)
                {
                    _passengerItem = value;
                    NotifyPropertyChanged("PassengerItem");
                }
            }
        }


        private List<BookingItemSegments> _segmentItem;
        public List<BookingItemSegments> SegmentItem
        {
            get
            {
                return _segmentItem;
            }
            set
            {
                if (value != _segmentItem)
                {
                    _segmentItem = value;
                    NotifyPropertyChanged("SegmentItem");
                }
            }
        }

        private PAYMENT _PAYMENTS;
        public PAYMENT PAYMENTS
        {
            get
            {
                return _PAYMENTS;
            }
            set
            {
                if (value != _PAYMENTS)
                {
                    _PAYMENTS = value;
                    NotifyPropertyChanged("PAYMENTS");
                }
            }
        }

        
        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }

    /*
      <PASSENGERS>
            <PASSENGER>
              <PassengerNo>1</PassengerNo>
              <PassengerName>TEPKHUMDEE/SURACHAI MR</PassengerName>
              <ClientPrflNo />
              <PassCode>ADULT</PassCode>
              <RequestNos />
              <RemarkNos />
            </PASSENGER>
            <PASSENGER>
              <PassengerNo>2</PassengerNo>
              <PassengerName>TEPKHUMDEE/PORNTIP MRS</PassengerName>
              <ClientPrflNo />
              <PassCode>ADULT</PassCode>
              <RequestNos />
              <RemarkNos />
            </PASSENGER>
        </PASSENGERS>
     */
    public class BookingItemPassengers : INotifyPropertyChanged
    {
        public string SeatNo
        {
            get
            {
                return App.ViewModel.SeatNo;
            }
            set
            {
                if (value != App.ViewModel.SeatNo)
                {
                    App.ViewModel.SeatNo = value;
                    NotifyPropertyChanged("SeatNo");
                }
            }
        }
        private string _PassengerNo;
        public string PassengerNo
        {
            get
            {
                return _PassengerNo;
            }
            set
            {
                if (value != _PassengerNo)
                {
                    _PassengerNo = value;
                    NotifyPropertyChanged("PassengerNo");
                }
            }
        }
        private string _PassengerName;
        public string PassengerName
        {
            get
            {
                return _PassengerName;
            }
            set
            {
                if (value != _PassengerName)
                {
                    _PassengerName = value;
                    NotifyPropertyChanged("PassengerName");
                }
            }
        }
        private string _PassCode;
        public string PassCode
        {
            get
            {
                return _PassCode;
            }
            set
            {
                if (value != _PassCode)
                {
                    _PassCode = value;
                    NotifyPropertyChanged("PassCode");
                }
            }
        }


        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
    /*
      <SEGMENTS>
            <SEGMENT>
              <RouteNo>1</RouteNo>
              <FlightNumber>DD8300</FlightNumber>
              <SellingClsCode>U</SellingClsCode>
              <FlightDate>25May2011</FlightDate>
              <DepartureCity>DMK</DepartureCity>
              <ArrivalCity>CNX</ArrivalCity>
              <ReserveStatus>HK</ReserveStatus>
              <FareNos>1</FareNos>
              <DepartureTime>07:35</DepartureTime>
              <ArrivalTime>08:45</ArrivalTime>
              <SeatRqstType>C</SeatRqstType>
              <BookNo>9804013</BookNo>
              <AltItineraryNo>1</AltItineraryNo>
              <ItineraryNo>0</ItineraryNo>
              <DepartureAirportCode>DMK</DepartureAirportCode>
              <ArrivalAirportCode>CNX</ArrivalAirportCode>
              <DepartureAirportName>DON MUEANG</DepartureAirportName>
              <DepartureCityName>DON MUEANG</DepartureCityName>
              <ArrivalAirportName>CHIANG MAI</ArrivalAirportName>
              <ArrivalCityName>CHIANG MAI</ArrivalCityName>
              <ItenaryStatFlag>A</ItenaryStatFlag>
              <RequestNos>1</RequestNos>
            </SEGMENT>
            <SEGMENT>
              <RouteNo>2</RouteNo>
              <FlightNumber>DD8319</FlightNumber>
              <SellingClsCode>U</SellingClsCode>
              <FlightDate>28May2011</FlightDate>
              <DepartureCity>CNX</DepartureCity>
              <ArrivalCity>DMK</ArrivalCity>
              <ReserveStatus>HK</ReserveStatus>
              <FareNos>2</FareNos>
              <DepartureTime>17:40</DepartureTime>
              <ArrivalTime>18:45</ArrivalTime>
              <SeatRqstType>C</SeatRqstType>
              <BookNo>9804013</BookNo>
              <AltItineraryNo>1</AltItineraryNo>
              <ItineraryNo>0</ItineraryNo>
              <DepartureAirportCode>CNX</DepartureAirportCode>
              <ArrivalAirportCode>DMK</ArrivalAirportCode>
              <DepartureAirportName>CHIANG MAI</DepartureAirportName>
              <DepartureCityName>CHIANG MAI</DepartureCityName>
              <ArrivalAirportName>DON MUEANG</ArrivalAirportName>
              <ArrivalCityName>DON MUEANG</ArrivalCityName>
              <ItenaryStatFlag>A</ItenaryStatFlag>
              <RequestNos>1</RequestNos>
            </SEGMENT>
          </SEGMENTS>
     */
    public class BookingItemSegments : INotifyPropertyChanged
    {
        public string From
        {
            get
            {
                return App.ViewModel.From;
            }
            set
            {
                if (value != App.ViewModel.From)
                {
                    App.ViewModel.From = value;
                    NotifyPropertyChanged("From");
                }
            }
        }

        public string To
        {
            get
            {
                return App.ViewModel.To;
            }
            set
            {
                if (value != App.ViewModel.To)
                {
                    App.ViewModel.To = value;
                    NotifyPropertyChanged("To");
                }
            }
        }
        public string Date
        {
            get
            {
                return App.ViewModel.Date;
            }
            set
            {
                if (value != App.ViewModel.Date)
                {
                    App.ViewModel.Date = value;
                    NotifyPropertyChanged("Date");
                }
            }
        }
        public string Dep
        {
            get
            {
                return App.ViewModel.Dep;
            }
            set
            {
                if (value != App.ViewModel.Dep)
                {
                    App.ViewModel.Dep = value;
                    NotifyPropertyChanged("Dep");
                }
            }
        }

        public string Arr
        {
            get
            {
                return App.ViewModel.Arr;
            }
            set
            {
                if (value != App.ViewModel.Arr)
                {
                    App.ViewModel.Arr = value;
                    NotifyPropertyChanged("Arr");
                }
            }
        }
        public string FlightNo
        {
            get
            {
                return App.ViewModel.FlightNo;
            }
            set
            {
                if (value != App.ViewModel.FlightNo)
                {
                    App.ViewModel.FlightNo = value;
                    NotifyPropertyChanged("FlightNo");
                }
            }
        }
        public string Class
        {
            get
            {
                return App.ViewModel.Class;
            }
            set
            {
                if (value != App.ViewModel.Class)
                {
                    App.ViewModel.Class = value;
                    NotifyPropertyChanged("Class");
                }
            }
        }
        private string _RouteNo;
        public string RouteNo
        {
            get
            {
                return _RouteNo;
            }
            set
            {
                if (value != _RouteNo)
                {
                    _RouteNo = value;
                    NotifyPropertyChanged("RouteNo");
                }
            }
        }  private string _FlightNumber;
        public string FlightNumber
        {
            get
            {
                return _FlightNumber;
            }
            set
            {
                if (value != _FlightNumber)
                {
                    _FlightNumber = value;
                    NotifyPropertyChanged("FlightNumber");
                }
            }
        }
        private string _SellingClsCode;
        public string SellingClsCode
        {
            get
            {
                return _SellingClsCode;
            }
            set
            {
                if (value != _SellingClsCode)
                {
                    _SellingClsCode = value;
                    NotifyPropertyChanged("SellingClsCode");
                }
            }
        }
        private string _FlightDate;
        public string FlightDate
        {
            get
            {
                return _FlightDate;
            }
            set
            {
                if (value != _FlightDate)
                {
                    _FlightDate = value;
                    NotifyPropertyChanged("FlightDate");
                }
            }
        }
        private string _DepartureTime;
        public string DepartureTime
        {
            get
            {
                return _DepartureTime;
            }
            set
            {
                if (value != _DepartureTime)
                {
                    _DepartureTime = value;
                    NotifyPropertyChanged("DepartureTime");
                }
            }
        }
        private string _ArrivalTime;
        public string ArrivalTime
        {
            get
            {
                return _ArrivalTime;
            }
            set
            {
                if (value != _ArrivalTime)
                {
                    _ArrivalTime = value;
                    NotifyPropertyChanged("ArrivalTime");
                }
            }
        }

        private string _ArrivalAirportName;
        public string ArrivalAirportName
        {
            get
            {
                return _ArrivalAirportName;
            }
            set
            {
                if (value != _ArrivalAirportName)
                {
                    _ArrivalAirportName = value;
                    NotifyPropertyChanged("ArrivalAirportName");
                }
            }
        }
        private string _DepartureAirportName;
        public string DepartureAirportName
        {
            get
            {
                return _DepartureAirportName;
            }
            set
            {
                if (value != _DepartureAirportName)
                {
                    _DepartureAirportName = value;
                    NotifyPropertyChanged("DepartureAirportName");
                }
            }
        }


        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }

    public class PAYMENT : INotifyPropertyChanged
    {
        /*
         <PAYMENTS>
      <PAYMENT>
        <PaymentNo>29179218</PaymentNo>
        <PaymentForm>CS</PaymentForm>
        <PaymentType>CS</PaymentType>
        <TypeDescription>Counter Service Plus</TypeDescription>
        <Description>7-Eleven</Description>
        <PaymentAmount>8972.10</PaymentAmount>
        <UnroundedPaymentAmount>8972.09961</UnroundedPaymentAmount>
        <PaymentDate>12Mar2011</PaymentDate>
        <PaymentDateTime>2011-03-12 15:56:51</PaymentDateTime>
        <OriginalDocumentNo />
        <DocumentNo />
        <PassengerName>TEPKHUMDEE/SURACHAI MR</PassengerName>
        <ClientProfileNo />
        <PassengerDescriptionCode />
        <BookAgencyCode />
        <RemarksText>Balance: Fare &amp; Tax = 8940.00, Fees = 0.00</RemarksText>
        <ReceivedFrom>TONG</ReceivedFrom>
        <PaidCurrencyCode>THB</PaidCurrencyCode>
        <PaidFlag>Y</PaidFlag>
        <PaymentStatusFlg>A</PaymentStatusFlg>
        <ContactPhoneNo />
        <ContactAddress />
        <ContactCity />
        <ContactState />
        <ContactZip />
        <ContactNation />
        <CcApprvCode />
        <CcApprvType />
        <CcExpiryDate />
        <CommonCurrencyFactor>1.00000</CommonCurrencyFactor>
      </PAYMENT>
    </PAYMENTS>
         */

        private string _PaymentNo;
        public string PaymentNo
        {
            get
            {
                return _PaymentNo;
            }
            set
            {
                if (value != _PaymentNo)
                {
                    _PaymentNo = value;
                    NotifyPropertyChanged("PaymentNo");
                }
            }
        }

        private string _PaymentAmount;
        public string PaymentAmount
        {
            get
            {
                return _PaymentAmount;
            }
            set
            {
                if (value != _PaymentAmount)
                {
                    _PaymentAmount = value;
                    NotifyPropertyChanged("PaymentAmount");
                }
            }
        }

        private string _PaymentDate;
        public string PaymentDate
        {
            get
            {
                return _PaymentDate;
            }
            set
            {
                if (value != _PaymentDate)
                {
                    _PaymentDate = value;
                    NotifyPropertyChanged("PaymentDate");
                }
            }
        }

        private string _PaymentDateTime;
        public string PaymentDateTime
        {
            get
            {
                return _PaymentDateTime;
            }
            set
            {
                if (value != _PaymentDateTime)
                {
                    _PaymentDateTime = value;
                    NotifyPropertyChanged("PaymentDateTime");
                }
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }


    public class SubmitBookingStatus : INotifyPropertyChanged
    {
        /*
<ViewModels.SubmitBookingStatus xmlns="">
  <SubmitID>1510738</SubmitID>
  <BookNo>3388876</BookNo>
  <Locator>HSLYPC</Locator>
  <ExternalLocator>HSLYPB</ExternalLocator>
  <Completed>True</Completed>
  <Stage>ETDONE</Stage>
</ViewModels.SubmitBookingStatus>

         */

        private string _SubmitID;
        public string SubmitID
        {
            get
            {
                return _SubmitID;
            }
            set
            {
                if (value != _SubmitID)
                {
                    _SubmitID = value;
                    NotifyPropertyChanged("SubmitID");
                }
            }
        }

        private string _BookNo;
        public string BookNo
        {
            get
            {
                return _BookNo;
            }
            set
            {
                if (value != _BookNo)
                {
                    _BookNo = value;
                    NotifyPropertyChanged("BookNo");
                }
            }
        }

        private string _Locator;
        public string Locator
        {
            get
            {
                return _Locator;
            }
            set
            {
                if (value != _Locator)
                {
                    _Locator = value;
                    NotifyPropertyChanged("Locator");
                }
            }
        }

        private string _ExternalLocator;
        public string ExternalLocator
        {
            get
            {
                return _ExternalLocator;
            }
            set
            {
                if (value != _ExternalLocator)
                {
                    _ExternalLocator = value;
                    NotifyPropertyChanged("ExternalLocator");
                }
            }
        }

        private string _Completed;
        public string Completed
        {
            get
            {
                return _Completed;
            }
            set
            {
                if (value != _Completed)
                {
                    _Completed = value;
                    NotifyPropertyChanged("Completed");
                }
            }
        }

        private string _Stage;
        public string Stage
        {
            get
            {
                return _Stage;
            }
            set
            {
                if (value != _Stage)
                {
                    _Stage = value;
                    NotifyPropertyChanged("Stage");
                }
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }                               
}
